/*
 * EDAS2 - TetraTech, Inc.
 *
 * Distributable under GPL license.
 * See terms of license at gnu.org.
 */
package com.tetratech.edas2.model;

import java.util.HashSet;
import java.util.Set;
import javax.persistence.CascadeType;
import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.FetchType;
import javax.persistence.Id;
import javax.persistence.OneToMany;
import javax.persistence.Table;
import org.hibernate.validator.Length;
import org.hibernate.validator.NotNull;

/**
 * HorizontalReferenceDatum generated by hbm2java
 */
@Entity
@Table(name = "ED_HORIZONTAL_REFERENCE_DATUM")
public class HorizontalReferenceDatum extends AttributableUpdateRetireEntity
		implements
			java.io.Serializable {

	private Long uid;
	private String name;
	private String description;
	private Set<MonitoringLocation> monitoringLocations = new HashSet<MonitoringLocation>(
			0);
	private Set<Activity> activities = new HashSet<Activity>(0);

	public HorizontalReferenceDatum() {
	}

	public HorizontalReferenceDatum(Long uid, String name, String description) {
		this.uid = uid;
		this.name = name;
		this.description = description;
	}

	@Id
	@Column(name = "HRDAT_UID", unique = true, nullable = false, precision = 6, scale = 0)
	@NotNull
	public Long getUid() {
		return this.uid;
	}

	public void setUid(Long uid) {
		this.uid = uid;
	}

	@Column(name = "HRDAT_NAME", nullable = false, length = 6)
	@NotNull
	@Length(max = 6)
	public String getName() {
		return this.name;
	}

	public void setName(String name) {
		this.name = name;
	}

	@Column(name = "HRDAT_DESC", nullable = false, length = 45)
	@NotNull
	@Length(max = 45)
	public String getDescription() {
		return this.description;
	}

	public void setDescription(String description) {
		this.description = description;
	}
	@OneToMany(cascade = CascadeType.ALL, fetch = FetchType.LAZY, mappedBy = "horizontalReferenceDatum")
	public Set<MonitoringLocation> getMonitoringLocations() {
		return this.monitoringLocations;
	}

	public void setMonitoringLocations(
			Set<MonitoringLocation> monitoringLocations) {
		this.monitoringLocations = monitoringLocations;
	}
	@OneToMany(cascade = CascadeType.ALL, fetch = FetchType.LAZY, mappedBy = "horizontalReferenceDatum")
	public Set<Activity> getActivities() {
		return this.activities;
	}

	public void setActivities(Set<Activity> activities) {
		this.activities = activities;
	}

}
